package com.hxzy.research.service.research.impl;

import com.hxzy.research.mapper.TblBranchMapper;
import com.hxzy.research.mapper.TblUserMapper;
import com.hxzy.research.pojo.TblBranch;
import com.hxzy.research.pojo.TblUser;
import com.hxzy.research.service.research.AddUserBranch;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AddUserBranchImpl implements AddUserBranch {
    @Autowired private TblBranchMapper tblBranchMapper;
    @Autowired private TblUserMapper tblUserMapper;
    @Override
    public void addBranch(TblBranch tblBranch) throws Exception {
        tblBranchMapper.addBranch(tblBranch);
    }

    @Override
    public TblBranch findBranchidByName(String name) throws Exception {
        return tblBranchMapper.findBranchidByName(name);
    }

    @Override
    public void addUser(TblUser tblUser) throws Exception {
        tblUserMapper.addUser(tblUser);
    }

    @Override
    public TblUser findUserByUserId(Integer userId) throws Exception {
        return tblUserMapper.findUserByUserId(userId);
    }

    @Override
    public void updateUser(TblUser tblUser) throws Exception {
        tblUserMapper.updateUser(tblUser);
    }

    @Override
    public void updateBranch(TblBranch tblBranch) throws Exception {
        tblBranchMapper.updateBranch(tblBranch);
    }

    @Override
    public void deleteUser(Integer userId) throws Exception {
        tblUserMapper.deleteUser(userId);
    }

    @Override
    public void deleteBranch(Integer branchId) throws Exception {
        tblBranchMapper.deleteBranch(branchId);
    }
}
